﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Handheld
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using System.Runtime.CompilerServices;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.iOS;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>Interface into functionality unique to handheld devices.</para>
  /// </summary>
  [NativeHeader("Runtime/Input/GetInput.h")]
  [NativeHeader("Runtime/Export/Handheld/Handheld.bindings.h")]
  [NativeHeader("Runtime/Video/MoviePlayback.h")]
  public class Handheld
  {
    /// <summary>
    ///   <para>Plays a full-screen movie.</para>
    /// </summary>
    /// <param name="path">Filesystem path to the movie file.</param>
    /// <param name="bgColor">Background color.</param>
    /// <param name="controlMode">How the playback controls are to be displayed.</param>
    /// <param name="scalingMode">How the movie is to be scaled to fit the screen.</param>
    public static bool PlayFullScreenMovie(
      string path,
      [DefaultValue("Color.black")] Color bgColor,
      [DefaultValue("FullScreenMovieControlMode.Full")] FullScreenMovieControlMode controlMode,
      [DefaultValue("FullScreenMovieScalingMode.AspectFit")] FullScreenMovieScalingMode scalingMode)
    {
      return Handheld.PlayFullScreenMovie_Bindings(path, bgColor, controlMode, scalingMode);
    }

    /// <summary>
    ///   <para>Plays a full-screen movie.</para>
    /// </summary>
    /// <param name="path">Filesystem path to the movie file.</param>
    /// <param name="bgColor">Background color.</param>
    /// <param name="controlMode">How the playback controls are to be displayed.</param>
    /// <param name="scalingMode">How the movie is to be scaled to fit the screen.</param>
    [ExcludeFromDocs]
    public static bool PlayFullScreenMovie(
      string path,
      Color bgColor,
      FullScreenMovieControlMode controlMode)
    {
      FullScreenMovieScalingMode scalingMode = FullScreenMovieScalingMode.AspectFit;
      return Handheld.PlayFullScreenMovie_Bindings(path, bgColor, controlMode, scalingMode);
    }

    /// <summary>
    ///   <para>Plays a full-screen movie.</para>
    /// </summary>
    /// <param name="path">Filesystem path to the movie file.</param>
    /// <param name="bgColor">Background color.</param>
    /// <param name="controlMode">How the playback controls are to be displayed.</param>
    /// <param name="scalingMode">How the movie is to be scaled to fit the screen.</param>
    [ExcludeFromDocs]
    public static bool PlayFullScreenMovie(string path, Color bgColor)
    {
      FullScreenMovieScalingMode scalingMode = FullScreenMovieScalingMode.AspectFit;
      FullScreenMovieControlMode controlMode = FullScreenMovieControlMode.Full;
      return Handheld.PlayFullScreenMovie_Bindings(path, bgColor, controlMode, scalingMode);
    }

    /// <summary>
    ///   <para>Plays a full-screen movie.</para>
    /// </summary>
    /// <param name="path">Filesystem path to the movie file.</param>
    /// <param name="bgColor">Background color.</param>
    /// <param name="controlMode">How the playback controls are to be displayed.</param>
    /// <param name="scalingMode">How the movie is to be scaled to fit the screen.</param>
    [ExcludeFromDocs]
    public static bool PlayFullScreenMovie(string path)
    {
      FullScreenMovieScalingMode scalingMode = FullScreenMovieScalingMode.AspectFit;
      FullScreenMovieControlMode controlMode = FullScreenMovieControlMode.Full;
      Color black = Color.black;
      return Handheld.PlayFullScreenMovie_Bindings(path, black, controlMode, scalingMode);
    }

    [FreeFunction("PlayFullScreenMovie")]
    private static bool PlayFullScreenMovie_Bindings(
      string path,
      Color bgColor,
      FullScreenMovieControlMode controlMode,
      FullScreenMovieScalingMode scalingMode)
    {
      return Handheld.PlayFullScreenMovie_Bindings_Injected(path, ref bgColor, controlMode, scalingMode);
    }

    /// <summary>
    ///   <para>Triggers device vibration.</para>
    /// </summary>
    [FreeFunction("Vibrate")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void Vibrate();

    /// <summary>
    ///   <para>Determines whether or not a 32-bit display buffer will be used.</para>
    /// </summary>
    [Obsolete("Property Handheld.use32BitDisplayBuffer has been deprecated. Modifying it has no effect, use PlayerSettings instead.")]
    public static bool use32BitDisplayBuffer
    {
      get => Handheld.GetUse32BitDisplayBuffer_Bindings();
      set
      {
      }
    }

    [FreeFunction("GetUse32BitDisplayBuffer_Bindings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool GetUse32BitDisplayBuffer_Bindings();

    [FreeFunction("SetActivityIndicatorStyle_Bindings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void SetActivityIndicatorStyleImpl_Bindings(int style);

    public static void SetActivityIndicatorStyle(ActivityIndicatorStyle style)
    {
      Handheld.SetActivityIndicatorStyleImpl_Bindings((int) style);
    }

    /// <summary>
    ///   <para>Sets the desired activity indicator style.</para>
    /// </summary>
    /// <param name="style"></param>
    public static void SetActivityIndicatorStyle(AndroidActivityIndicatorStyle style)
    {
      Handheld.SetActivityIndicatorStyleImpl_Bindings((int) style);
    }

    /// <summary>
    ///   <para>Gets the current activity indicator style.</para>
    /// </summary>
    [FreeFunction("GetActivityIndicatorStyle_Bindings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern int GetActivityIndicatorStyle();

    /// <summary>
    ///   <para>Starts os activity indicator.</para>
    /// </summary>
    [FreeFunction("StartActivityIndicator_Bindings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void StartActivityIndicator();

    /// <summary>
    ///   <para>Stops os activity indicator.</para>
    /// </summary>
    [FreeFunction("StopActivityIndicator_Bindings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void StopActivityIndicator();

    [FreeFunction("ClearShaderCache_Bindings")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void ClearShaderCache();

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool PlayFullScreenMovie_Bindings_Injected(
      string path,
      ref Color bgColor,
      FullScreenMovieControlMode controlMode,
      FullScreenMovieScalingMode scalingMode);
  }
}
